import pandas as pd
import matplotlib.pyplot as plt

peoples = pd.read_csv('data/相亲对象.csv',encoding='gbk')
print(peoples)
peoples_groupby = peoples['学历'].groupby(peoples['学历']).count() #按学历分组 count统计re人数

plt.figure(figsize=(6,5))#设置画布大小
valuelist = list(peoples_groupby)
namelist = list(peoples_groupby.keys())
plt.rcParams['font.sans-serif'] = 'SimHei'
plt.title ='相亲对象学历统计'
plt.pie(valuelist,labels=namelist)
plt.show()